#ifndef VISAGE_H
#define VISAGE_H

#include <opencv/highgui.h>
#include <opencv/cv.h>
#include <QMainWindow>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>

//#include "mainwindow.h"

// Maths methods
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define abs(x) ((x) > 0 ? (x) : -(x))
#define sign(x) ((x) > 0 ? 1 : -1)

// Step mooving for object min & max
#define STEP_MIN 5
#define STEP_MAX 100


struct S_point{
    int x;
    int y;
    int dir;
};

namespace Ui {
    class MainWindow;
}

using namespace std;

class C_dessine_visage
{
    public :
        CvPoint binarisation(IplImage* image, int *nbPixels);
        void findPoint();
        S_point pointSuivant(IplImage* img_contour,CvPoint precd,int direction);
        CvPoint trouvelegato(IplImage* p_image_b);
        C_dessine_visage(IplImage * ipl);
        vector<S_point> getvector(int i);
        vector<S_point> pointFinal2;
        vector<S_point> pointFinal;
        vector<S_point> pointFinal3;

protected:

    private:
        Ui::MainWindow *ui;
        IplImage *image;
        IplImage *binair;
        int h;
        int s;
        int v;
        int tolerance;
};
#endif
